package synchronicity.ui;

import java.util.Date;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;

import ui.DisplayContext;
import ui.Screen;

public class MeetingScheduledScreen extends Screen {

	private Date start, end;

	private String title;

	private Form container;

	private StringItem startTime;

	private StringItem endTime;

	private StringItem titleItem;

	public MeetingScheduledScreen(DisplayContext context, Date startDate,
			Date endDate, String title) {
		super(context);
		start = startDate;
		end = endDate;
		this.title = title;

		startTime = new StringItem("Start: ", start.toString() + "\n");
		endTime = new StringItem("End: ", end.toString() + "\n");
		titleItem = new StringItem("Title ", this.title + "\n");

		container = new Form("Meeting scheduled");
		container.append(titleItem);
		container.append(startTime);
		container.append(endTime);
	}

	protected Command[] getCommands() {
		return getDefaultCommands();
	}

	protected Displayable getDisplayable() {
		return container;
	}

	protected String getTitle() {
		return "Synchronicity";
	}

	public void commandAction(Command arg0, Displayable arg1) {
		switchScreen(getContext().getPreviousScreen());
	}
}
